package com.itheima.health.controller;


import com.itheima.health.entity.Result;
import com.itheima.health.pojo.CheckItem;
import com.itheima.health.service.CheckItemService;
import com.itheima.health.utils.resources.MessageConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.validation.MessageCodeFormatter;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api("传智健康检查项接口文档API")
@RestController
public class CheckltemController {

    @Reference
    private CheckItemService checkitemService;

    @GetMapping("/checkitem/findAll")
    @ApiOperation(value = "删除检查项", notes = "根据检查项id 逻辑删除检查项")
    public Result findAll(){
        try {
            List<CheckItem> list =checkitemService.list();
            return new Result(true, MessageConstant.QUERY_CHECKITEM_SUCCESS,list);

        }catch (Exception e){
            e.printStackTrace();
            return new Result(false,MessageConstant.QUERY_CHECKGROUP_FAIL);
        }
    }
}
